package com.zr.spring.bean;


import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Solution {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext cxt = new AnnotationConfigApplicationContext(BeanConfig.class);
        UserFunctionService bean = cxt.getBean(UserFunctionService.class);
        System.out.println(bean.functionService.sayHello("hello bean"));

        FunctionService functionService = (FunctionService) cxt.getBean("functionService");
        System.out.println(functionService.sayHello("ZhangRui"));
        cxt.close();
    }
}
